import type { CodeType, User } from '@/types/user'
import { request } from '@/utils/request'

export const loginByPaassword = (mobile: string, password: string) => {
  return request<User>('/login/password', 'POST', {
    mobile,
    password,
  })
}

export const getCode = (mobile: string, type: CodeType) => {
  return request<{ code: string }>('/code', 'GET', {
    mobile,
    type,
  })
}
